<%@ page language="java" import="java.util.*,com.ejuornal.util.Constants" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>中国刊网--文章阅读</title>

<link href="css/category.css" rel="stylesheet" type="text/css" />
<link href="css/read.css" rel="stylesheet" type="text/css" />
<link href="css/articalRead.css" rel="stylesheet" type="text/css" />

<script src="js/jquery-1.9.1.js" type="text/javascript"></script>
<script src="js/jquery.json-2.4.js" type="text/javascript"></script>
<script src="layer-v1.5.1/layer/layer.min.js" type="text/javascript"></script>
<script src="js/warningMsg.js" type="text/javascript"></script>
<script src="js/read.js" type="text/javascript"></script>
<%-- Baidu Button BEGIN --%>
<script type="text/javascript" id="bdshare_js" data="type=tools&amp;uid=0"></script>
<script type="text/javascript" id="bdshell_js"></script>
<%-- 分享js --%>
<script type="text/javascript">
document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion="
	+ Math.ceil(new Date() / 3600000);
</script>
<%-- 分享js --%>
<%-- Baidu Button END --%>
</head>
<body>
<input type="hidden" id="userId" value="${sessionScope.user_sessionid}" />
<jsp:include page="top.jsp" />
	<div class="content">
		<div class="ziye-daohang">所在位置：<a href="index.jsp">首页</a>&nbsp;&gt;&nbsp;文章阅读</div>
		<div class="content-left" style="margin-bottom:0px;">
			<div class="col_left">
				<input id='articalIdHidd' type="hidden" value="${artical.articalId }" />
				<div class="col_left_daohang">
					<div class="col_left_title"><span>${artical.title }</span></div>
					<%-- 文章标题 --%>
					<div class="col_left_text_fun">
						<span>${periodical.name}</span> 
						<span>${articalUserName}</span>
						<%-- 作者 --%>
						<span>${artical.pubDate }</span>
						<%-- 日期 --%>
						<span>中国刊网</span>
						<span>浏览次数：${artical.viewCount }</span>
					</div>

					<%-- 文章导读-开始 --%>
					<div class="artical_intr">
						<div style="float:left; display:block; width:40px; text-align:right;">导读：</div> 
						<div style="float:left; width:535px; font-family:宋体; padding-right:2px;">${artical.cnAbstract }</div>
						<div style="clear:both; float:left; display:block; width:40px; text-align:right;">英文：</div> 
						<div style="float:left; width:535px; font-family:宋体; padding-right:2px;">${artical.enAbstract }</div>
					</div>
					<%-- 文章导读 -结束--%>
					<%-- null == sessionScope.getAttribute(Constants.USERSESSION)%>--%>
					<div class="col_left_text3">
						<%--文章内容  开始--%>
						<c:if test="${sessionScope.user_session != null}">
									${artical.content }
							<div class="references">
								<span style="font-size:14px;font-weight:bold;">参考文献：<br /></span>
								<c:forEach items="${requestScope.refDocList}" var="list">
									<span style="margin-left:40px;"> ${list }<br /> </span>
								</c:forEach>
							</div>
						</c:if>
						<c:if test="${sessionScope.user_session == null }">
							<div class="hiddenContent_login">
								<img class="img" src="images/lock.jpg" />
								<span>您还未登录，登录后才能看到本文章内容！！</span>
								<a href="html/userLogin.jsp">登录</a>
							</div>
						</c:if>
						<%-- 当没有登录时显示 --%>
						<%--文章内容  结束--%>
						<div id="bdshare" class="bdshare_t bds_tools get-codes-bdshare">
							<span class="bds_more" style="padding:2px;">分享到：</span>
							<a class="bds_qzone"></a> 
							<a class="bds_tsina"></a> 
							<a class="bds_tqq"></a> 
							<a class="bds_renren"></a>
							<a class="bds_t163"></a>
							<a class="shareCount"></a>
						</div>
						<div id="articalStore">
							<input id="articalId" type="hidden" value="${artical.articalId}" />
							<input id="storeShow" type="button" onclick="storeSubmit()" class="btnStyle" value="收藏" />
							<%-- <a href="store/addStore?articalIdString=${artical.articalId}">收藏</a> --%>
						</div>
					</div>

					<div class="tab-2"><strong>读者评论</strong></div>

					<%--文章评论 --%>
					<c:forEach items="${requestScope.pages.records}" var="list">
						<div class="col_left_text_ping" style="margin-top:27px;">
							<div id="col_left_text_name">
								${list.userName } <span class="scolor">&nbsp;&nbsp;&nbsp;说：</span>
							</div>
							<%-- 评论内容开始 --%>
							<div id="col_left_text_content">${list.content }</div>
							<%-- 评论内容结束 --%>
							<div class="col_left_text_ping2">${list.commDate }</div>
						</div>
					</c:forEach>

					<%-- 评论分页 --%>
					<div class="col_left_text_span" style="width:450px;margin-left:20px;margin-top:10px;">
						<jsp:include page="/page2.jsp" />
					</div>

					<!-- 星评内容开始 -->
					<div class="shop-rating" style="margin-left:20px;margin-top:10px;">
						<span class="title" style="font-size:14px; font-weight:bold;text-align:left;">评分：</span>
						<ul class="rating-level" id="stars2">
							<li><a name="starts" class="one-star" star:value="20" href="javascript:void(0)">20</a></li>
							<li><a name="starts" class="two-stars" star:value="40" href="javascript:void(0)">40</a></li>
							<li><a name="starts" class="three-stars" star:value="60" href="javascript:void(0)">60</a></li>
							<li><a name="starts" class="four-stars" star:value="80" href="javascript:void(0)">80</a></li>
							<li><a name="starts" class="five-stars" star:value="100" href="javascript:void(0)">100</a></li>
						</ul>
						<span style="font-size:12px;margin-left:20px; color:#FF0000;">(请对该资源打分)</span>
						<span style="margin-left:20px;" class="result" id="stars2-tips"></span>
						<input type="hidden" id="stars2-input" name="b" value="" size="2" />
						<input type="hidden" id="myScore"/><!-- 得分隐藏域 -->
					</div>
					<!-- 星评内容结束 -->


					<div class="col_left_textarea">
						<div id="commentAfter"></div>
						<textarea class="commentContent_1" rows="4" cols="66" id="commentCon" onblur="commentContentBlur()" onclick="commentContentVali()">登录后才能发表评论！</textarea>
						<div class="col_left_button1">
							<span id="commentMsg" class="warningStyle"></span>
							<input type="button" onclick="commentSubmit()" class="btnStyle" value="提交" />
						</div>
					</div>
					<div style="height:120px;width:500px;clear:both;"></div>
				</div>
			</div>
		</div>
		<%-----------------------左容器------%>

		<div class="col_right">
			<div class="col_right_top">
				<a href="${ads.url }"><img src="${ads.picSrc }" width="290px" height="178px" /></a>
			</div>
			<%----------------------------顶上广告--%>
			<div class="col_right-a1">
				<div class="col_right_tap">文章推荐</div>
				<%---------------------小标签---%>
				<div class="col_right_list">
					<ul>
					<%int i=1; %>
						<c:forEach items="${recommendArtical}" var="list">
							<li>
								<div class="col_right_a_1">
								
									<img src="images/num<%=i++ %>.gif" align="top">
									<a href="artical/articalDetialInfo.action?articalId=${list.articalId }">${list.title}</a>
								</div>
							</li>
						</c:forEach>
					</ul>
				</div>
			</div>

			<div class="col_right-a1">
				<div class="col_right_tap">热门期刊</div>
				<%---------------------小标签---%>
				<div class="col_right_list">
					<ul>
					<%int j=1;%>
						<c:forEach items="${hotPeriodicals }" var="perList">
							<li>
								<div class="col_right_a_1">
									<img src="images/num<%=j++ %>.gif" align="top">
									<a href="subscribeB/findNewPerPeriodical?periodical.periodicalId=${perList.periodicalId }">${perList.name }</a>
								</div>
							</li>
						</c:forEach>
					</ul>
				</div>
			</div>
		</div>
		<%----------------------右容器----%>
	</div>
	<div class="clear"></div>
<jsp:include page="footer.jsp" />
<script type="text/javascript">
		var Class = {
			create: function() {
				return function() { this.initialize.apply(this, arguments); };
			}
		};
		var Extend = function(destination, source) {
			for (var property in source) {
				destination[property] = source[property];
			}
		};
		function stopDefault( e ) {
			 if ( e && e.preventDefault ){
				e.preventDefault();
			}else{
				window.event.returnValue = false;
			}
			return false;
		} 
		/**
		 * 星星打分组件
		 *
		 * @author	Yunsd
		 * @date		2010-7-5
		 */
		var Stars = Class.create();
		Stars.prototype = {
			initialize: function(star,options) {
				this.SetOptions(options); //默认属性
				var flag = 999; //定义全局指针
				var isIE = (document.all) ? true : false; //IE?
				var starlist = document.getElementById(star).getElementsByTagName('a'); //星星列表
				var input = document.getElementById(this.options.Input) || document.getElementById(star+"-input"); // 输出结果
				var tips = document.getElementById(this.options.Tips) || document.getElementById(star+"-tips"); // 打印提示
				var nowClass = " " + this.options.nowClass; // 定义选中星星样式名
				var tipsTxt = this.options.tipsTxt; // 定义提示文案
				var len = starlist.length; //星星数量
				for(i=0;i<len;i++){ // 绑定事件 点击 鼠标滑过
					starlist[i].value = i;
					starlist[i].onclick = function(e){
						stopDefault(e);
						this.className = this.className + nowClass;
						flag = this.value;
						input.value = this.getAttribute("star:value");
						tips.innerHTML = tipsTxt[this.value];
						$("#myScore").val(tipsTxt[this.value]);
						
						////////////////////////////////////////////////////////////
					};
					starlist[i].onmouseover = function(){
						if (flag< 999){
							var reg = RegExp(nowClass,"g");
							starlist[flag].className = starlist[flag].className.replace(reg,"");
						}
					};
					starlist[i].onmouseout = function(){
						if (flag< 999){
							starlist[flag].className = starlist[flag].className + nowClass;
						}
					};
				};
				if (isIE){ //FIX IE下样式错误
					var li = document.getElementById(star).getElementsByTagName('li');
					for (var i = 0, len = li.length; i < len; i++) {
						var c = li[i];
						if (c) {
							c.className = c.getElementsByTagName('a')[0].className;
						}
					}
				}
			},
			//设置默认属性
			SetOptions: function(options) {
				this.options = {//默认值
					Input:			"",//设置触保存分数的INPUT
					Tips:			"",//设置提示文案容器
					nowClass:	"current-rating",//选中的样式名
					tipsTxt:		["1","2","3","4","5"]//提示文案
				};
				Extend(this.options, options || {});
			}
		};
		
		/* For TEST */
		function teststars(){
			alert(document.getElementById("stars1-input").value + "|" + document.getElementById("stars2-input").value);
		}
		var Stars2 = new Stars("stars2");
		</script>
	
</body>
</html>